//
//  StorageScene.h
//  SpaceStorm
//
//  Created by  mmj on 13-7-9.
//
//
#import "cocos2d.h"
#import <Foundation/Foundation.h>

@interface StorageItem :  CCNode
{
    //变量申明
    int itemIndex;
    NSUserDefaults *ud;
    NSData * udObject;
    NSString* dataKey;
    
    //人物
    CCSprite *ppLineNormal;
    CCSprite *ppLineClick;
    CCSprite *ppReadNormal;
    CCSprite *ppReadClick;
    CCSprite *ppNewSaveNormal;
    CCSprite *ppNewSaveClick;
    CCSprite *ppHead;
    CCSprite *ppOutHead;
    
    //用户文本
    CCLabelTTF* ppType;
    CCLabelTTF* ppName;
    CCLabelTTF* ppLevel;
    CCLabelTTF* ppDate;
    CCLabelTTF* ppGoldNum;
    CCLabelTTF* ppArmNeedNum;
    CCLabelTTF* ppWarShipNum;
    
    CCMenuItemSprite *ppLine;  //线条
    CCMenuItemSprite *ppClcikRead;  //点击读取
    CCMenuItemSprite *ppNewSave;  //新建存档
    CCSprite *ppClickRead;
    
    CCLabelTTF *ppGold;
    //军需
    CCLabelTTF *ppArmNeed;
    //舰队规模
    CCLabelTTF *ppWarShip;
    
    //创建新存档
    CCSprite *ppFloor;
    CCSprite *newFloor;

    
    CCMenu*	menu;
   
}


+(id) itemWithIndex:(int)index;
-(id) initWithIndex:(int)index;

-(void) onPeopleLineButton:(id)sender;
-(void) onPeopleClcikReadButton:(id)sender;
-(void) onPeopleNewSaveButton:(id)sender;
-(void) onDeletePeopleSaveData;
-(void) hideHaveData;
-(void) hideNewCreate;
-(void) showHaveData;
-(void) showNewCreate;
-(void) updateUserItemInfo;



//属性 d
@end

//删除玩家信息  弹出窗口
@interface StorageWindowItem :  CCNode
{
//    CCSprite* sureNormal;
//    CCSprite* sureClick;
//    
//    CCMenuItemSprite *menuSure;  //确定
//    CCMenuItemSprite *menuCancel;  //取消
//    CCMenu*	menu;
    id _target;
    SEL _okSelector;
}

+(id) windowItemWithTarget:(id)target ok:(SEL)okSelector;
-(id) initItemWith:(id)target ok:(SEL)okSelector;
-(void) initBackGround;
-(void) onWindowSureButton:(id)sender;
-(void) onWindowCancelButton:(id)sender;



@end


@interface StorageScene : CCLayer
{
    CGSize size;
    CCMenu*	menu;
    NSUserDefaults *ud;
    StorageItem *storageItem1;
    StorageItem *storageItem2;
    StorageItem *storageItem3;
}

+(CCScene *) scene;
-(void) initBackGround;
-(void) initHead;
@end
